const { createProxyMiddleware } = require("http-proxy-middleware")

module.exports = function (app) {
    app.use(
        createProxyMiddleware(
            '/tyj', {
            // target: "http://192.168.2.108:7001",
            target: "http://192.168.2.98:7001",
            changeOrigin: true,
            pathRewrite: { "^/tyj": '' }
        }),
        createProxyMiddleware(
            '/yywd', {
            // target: "http://192.168.2.104:7001",
            target: "http://192.168.2.98:7001",
            changeOrigin: true,
            pathRewrite: { "^/yywd": '' }
        }),
        createProxyMiddleware(
            '/lyq', {
            target: "http://192.168.2.98:7001",
            changeOrigin: true,
            pathRewrite: { "^/lyq": '' }
        }),
        createProxyMiddleware(
            '/zjr', {
            target: "http://192.168.2.108:7001",
            changeOrigin: true,
            pathRewrite: { "^/zjr": '' }
        })
    )
};